package cn.jzq.kotoba.modules.designpattern.strategy.charge;

import lombok.Getter;

@Getter
public enum  ChargeTypeEnum {

    /**
     *
     */
    E_BANK(1, "网银"),
    /**
     *
     */
    USER_ACCOUNT(2, "用户账号"),
    /**
     *
     */
    MOBILE(3, "手机卡充值"),
    /**
     *
     */
    CARD_CHARGE(4, "充值卡充值");

    /**
     * 充值类型
     */
    private Integer type;

    /**
     * 充值类型说明
     */
    private String description;

    ChargeTypeEnum(Integer type, String description) {
        this.type = type;
        this.description = description;
    }


    /**
     * 根据type获取description
     * @param type
     * @return
     */
    public static ChargeTypeEnum valueOf(Integer type) {
        for(ChargeTypeEnum chargeType : ChargeTypeEnum.values()) {
            if(chargeType.getType().equals(type)) {
                return chargeType;
            }
        }
        return  E_BANK;
    }


}
